package com.wolfeyes.common.core.enums.order;

/**
 * 
 * @description 订单服务信息-服务类型信息枚举管理
 * @projectName film
 * @className ServerTypeEnum.java
 * @author yanyl
 * @since 2017年02月02日下午4:37:39
 * @createTime 2018年02月03日 下午13:04:13
 * @version 1.0.0
 * @return String
 * @throws Exception
 */
public enum ServerTypeEnum {
	
    Zero(0, "未知哦"),One(1,"劳务派遣"),Two(2,"劳务外包"),Three(3,"代缴社会保险"),
    Four(4,"代缴住房公积金"),Five(5,"待定555");
	
	//类型编号
	Integer type;
	//类型名称
    String value;

    ServerTypeEnum(Integer type, String value) {
        this.value = value;
        this.type = type;
    }

    public static String getValue(int type) {
        ServerTypeEnum[] accountTypes = ServerTypeEnum.values();
        if (accountTypes != null && accountTypes.length > 0){
            for (ServerTypeEnum accountType : accountTypes){
                if (accountType.type == type){
                    return accountType.value;
                }
            }
        }
        return null;
    }
    
    public int getType() {
        return type;
    }
    
    public String getValue() {
        return value;
    }
    
    public static ServerTypeEnum getTypeEnume(int type){
        ServerTypeEnum[] accountTypes = ServerTypeEnum.values();
        if (accountTypes != null && accountTypes.length > 0){
            for (ServerTypeEnum accountType : accountTypes){
                if (accountType.type == type){
                    return accountType;
                }
            }
        }
        return null;
    }
}
